package com.tudouji.project.flow.service.impl;

import java.util.List;
import com.tudouji.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tudouji.project.flow.mapper.FlowTaskMapper;
import com.tudouji.project.flow.domain.FlowTask;
import com.tudouji.project.flow.service.IFlowTaskService;

/**
 * 流程任务Service业务层处理
 * 
 * @author tudouji
 * @date 2022-06-20
 */
@Service
public class FlowTaskServiceImpl implements IFlowTaskService
{
    @Autowired
    private FlowTaskMapper flowTaskMapper;

    /**
     * 查询流程任务
     * 
     * @param id 流程任务ID
     * @return 流程任务
     */
    @Override
    public FlowTask selectFlowTaskById(Long id)
    {
        return flowTaskMapper.selectFlowTaskById(id);
    }

    /**
     * 查询流程任务列表
     * 
     * @param flowTask 流程任务
     * @return 流程任务
     */
    @Override
    public List<FlowTask> selectFlowTaskList(FlowTask flowTask)
    {
        return flowTaskMapper.selectFlowTaskList(flowTask);
    }

    /**
     * 新增流程任务
     * 
     * @param flowTask 流程任务
     * @return 结果
     */
    @Override
    public int insertFlowTask(FlowTask flowTask)
    {
        flowTask.setCreateTime(DateUtils.getNowDate());
        return flowTaskMapper.insertFlowTask(flowTask);
    }

    /**
     * 修改流程任务
     * 
     * @param flowTask 流程任务
     * @return 结果
     */
    @Override
    public int updateFlowTask(FlowTask flowTask)
    {
        return flowTaskMapper.updateFlowTask(flowTask);
    }

    /**
     * 批量删除流程任务
     * 
     * @param ids 需要删除的流程任务ID
     * @return 结果
     */
    @Override
    public int deleteFlowTaskByIds(Long[] ids)
    {
        return flowTaskMapper.deleteFlowTaskByIds(ids);
    }

    /**
     * 删除流程任务信息
     * 
     * @param id 流程任务ID
     * @return 结果
     */
    @Override
    public int deleteFlowTaskById(Long id)
    {
        return flowTaskMapper.deleteFlowTaskById(id);
    }

    @Override
    public List<FlowTask> selectPendingList(FlowTask flowTask) {
        return flowTaskMapper.selectPendingList(flowTask);
    }
}
